package com.longxi.tianjintianbao.ui.activity.patrol;

import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.widget.EditText;
import android.widget.RadioGroup;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.patrol.EditPatrolResultsAtPresenter;
import com.longxi.tianjintianbao.ui.view.patrol.IEditPatrolResultsAtView;

import butterknife.BindView;

/**
 * Created by 70339 on 2018/5/17.
 * 代码无八阿哥
 * 阿弥陀佛
 */
public class EditPatrolResultsActivity extends BaseActivity<IEditPatrolResultsAtView, EditPatrolResultsAtPresenter> implements IEditPatrolResultsAtView {
    @BindView(R.id.etContent)
    EditText mEtContent;
    @BindView(R.id.recyclerView)
    RecyclerView mRecyclerView;
    @BindView(R.id.radioGroup)
    RadioGroup mRadioGroup;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_edit_patrol_results;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
        mPresenter.initListener();
        mPresenter.initSelectImage(getRecyclerView(), 2);

        mTvRight.setOnClickListener(v -> mPresenter.onClickSaveBtn());
    }

    @Override
    protected EditPatrolResultsAtPresenter createPresenter() {
        return new EditPatrolResultsAtPresenter(this);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode != RESULT_OK) {
            return;
        }
        mPresenter.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public EditText getEtContent() {
        return mEtContent;
    }

    @Override
    public RecyclerView getRecyclerView() {
        return mRecyclerView;
    }

    @Override
    public RadioGroup getRadioGroup() {
        return mRadioGroup;
    }
}
